<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/6
 * Time: 20:55
 */

require_once "../../config/database.php";
require_once "UserDb.php";
$UserDb = new UserDb();
$id = $_POST['id'];
$data = $UserDb->del_order($id);
file_put_contents("id.txt", $id . "=" . $data);
try {
    $result = $data;
    if ($result) {
        $dat = array(
            'message' => "删除成功",
        );
        echo json_encode($dat);
    } else {
        echo "删除失败";
    }
} catch (Exception $e) {
    echo $e->getMessage();
}
